package cn.edu.scau.cmi.front.domain;

import java.io.Serializable;

import cn.edu.scau.cmi.ema.domain.Foodbatch;

public class EventFoodbatch  implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	Integer eventId;
	
	Foodbatch foodbatch;

	public EventFoodbatch(Integer eventId, Foodbatch foodbatch) {
		super();
		this.eventId = eventId;
		this.foodbatch = foodbatch;
	}
	
	public Integer getEventId() {
		return eventId;
	}

	public void setEventId(Integer eventId) {
		this.eventId = eventId;
	}

	public Foodbatch getFoodbatch() {
		return foodbatch;
	}

	public void setFoodbatch(Foodbatch foodbatch) {
		this.foodbatch = foodbatch;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((foodbatch == null) ? 0 : foodbatch.hashCode());
		result = prime * result + ((eventId == null) ? 0 : eventId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		EventFoodbatch other = (EventFoodbatch) obj;
		if (foodbatch == null) {
			if (other.foodbatch != null)
				return false;
		} else if (!foodbatch.equals(other.foodbatch))
			return false;
		if (eventId == null) {
			if (other.eventId != null)
				return false;
		} else if (!eventId.equals(other.eventId))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "EventFoodbatch [eventId=" + eventId + ", foodbatch=" + foodbatch + "]";
	}
}
